package goalie.example;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import goalie.Component;

public class Plus implements Component {

  public static String REFERRED_NAME = "plus";
  
  @Override
  public void cleanup(Map<String, String> outputs) throws IOException {
    // Nothing to do.
  }

  @Override
  public Map<String, String> run(Map<String, String> params) throws IOException {
    Integer i = Integer.parseInt(params.get("arg1")) + 
      Integer.parseInt(params.get("arg2"));
    Map<String, String> resultMap = new HashMap<String, String>();
    resultMap.put("result", i.toString());
    return resultMap;
  }
}
